package com.qidi.service;

import com.qidi.bean.Emp;
import com.qidi.dao.EmpMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhouXinBin
 * @create 2020-11-04-9:33
 */
@Service
public class EmpService {

    @Autowired
    EmpMapper empMappe;

    public void saveEmp(Emp emp){
        empMappe.add(emp);
    }

    public void updateEmp(Emp emp){
        empMappe.update(emp);
    }
    public void deleteEmp(Integer eid){
        empMappe.delete(eid);
    }

    public Emp queryEmpById(Integer eid){
        return empMappe.getById(eid);
    }

    public List<Emp> queryAll(){
        return empMappe.getAll();
    }
}
